package com.hmall.order.web;

import com.hmall.common.dto.client.ItemClient;
import com.hmall.common.dto.client.UserClient;
import com.hmall.common.dto.pojo.Address;
import com.hmall.common.dto.pojo.Item;
;
import com.hmall.order.interceptor.UserThreadLocal;
import com.hmall.order.pojo.Order;
import com.hmall.order.pojo.OrderDetail;
import com.hmall.order.pojo.OrderLogistics;
import com.hmall.order.pojo.OrderParams;
import com.hmall.order.service.IOrderDetailService;
import com.hmall.order.service.IOrderService;
import com.hmall.order.service.IlogisticsService;

import com.hmall.order.service.impl.logisticsService;
import org.springframework.beans.factory.annotation.Autowired;



import org.springframework.web.bind.annotation.*;

import java.util.Date;

@RestController
@RequestMapping("order")
public class OrderController {

   @Autowired
   private IOrderService orderService;

   @GetMapping("{id}")
   public Order queryOrderById(@PathVariable("id") Long orderId) {
      return orderService.getById(orderId);
   }

   @PostMapping
   public Long Insert(@RequestBody OrderParams params){
   return orderService.Insert(params);
   }
}
